<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="/WEB-INF/template/common/taglibs.jspf" %>
<es:contentHeader/>

<t:base type="jquery,jquery-ui-bootstrap:bootstrap,jquery-ui-bootstrap:jquery-ui,query-ui-bootstrap:jquery.layout,jquery-ui-bootstrap:font-awesome"></t:base>
<t:base type="jquery-ui-bootstrap:jquery.blockUI,jquery-ui-bootstrap:bootstrap.file-input,bootstrap-datetimepicker,nicescroll,jqueryValidate,application,common,datePicker"></t:base>


<style type="text/css">
    .error{
        color:red;
    }
</style>

<div class="panel">
    <ul class="nav nav-tabs">
        <shiro:hasPermission name="sys:user:create">
            <c:if test="${op eq '新增'}">
                <li ${op eq '新增' ? 'class="active"' : ''}>
                    <a href="<%=request.getContextPath()%>/admin/bookingContainer/create">
                        <i class="icon-file-alt"></i>
                        新增
                    </a>
                </li>
            </c:if>
        </shiro:hasPermission>

        <c:if test="${not empty m.id}">
            <li ${op eq '查看' ? 'class="active"' : ''}>
                <a href="<%=request.getContextPath()%>/admin/bookingContainer/${m.id}">
                    <i class="icon-eye-open"></i>
                    查看
                </a>
            </li>
            <shiro:hasPermission name="sys:user:update">
                <li ${op eq '修改' ? 'class="active"' : ''}>
                    <a href="<%=request.getContextPath()%>/admin/bookingContainer/${m.id}/update">
                        <i class="icon-edit"></i>
                        修改
                    </a>
                </li>
            </shiro:hasPermission>
            <shiro:hasPermission name="sys:user:delete">
                <li ${op eq '删除' ? 'class="active"' : ''}>
                    <a href="<%=request.getContextPath()%>/admin/bookingContainer/${m.id}/delete">
                        <i class="icon-trash"></i>
                        删除
                    </a>
                </li>
            </shiro:hasPermission>
        </c:if>
    </ul>

    <form:form id="editForm" method="post" commandName="m" cssClass="form-inline form-horizontal form-small">
        <es:showGlobalError commandName="m"/>
        <form:hidden path="id"/>
        <div id="baseinfo">
            <h4 class="hr">海关手册明细项目新增</h4>

            <input type="hidden" name="customsHandBookId" value="${m.customsHandBookId}">

            <div class="control-group span4">
                <form:label path="itemCode" cssClass="control-label">项号</form:label>
                <div class="controls inline-radio">
                        <form:input path="itemCode"/>
                </div>
            </div>

            <div class="control-group span4">
                <form:label path="specifications" cssClass="control-label">规格</form:label>
                <div class="controls inline-radio">
                    <form:input path="specifications"/>
                </div>
            </div>


            <div class="control-group span4">
                <form:label path="recordQty" cssClass="control-label">备案数量</form:label>
                <div class="controls inline-radio">
                    <form:input path="recordQty"/>
                </div>
            </div>

            <div class="control-group span4">
                <form:label path="leftQty" cssClass="control-label">剩余量</form:label>
                <div class="controls inline-radio">
                    <form:input path="leftQty"/>
                </div>
            </div>


            <div class="control-group span4">
                <form:label path="forzenQty" cssClass="control-label">冻结量</form:label>
                <div class="controls">
                    <form:input path="forzenQty"/>
                </div>
            </div>

            <div class="control-group span4">
                <form:label path="singleWeight" cssClass="control-label">单重</form:label>
                <div class="controls">
                    <form:input path="singleWeight"/>
                </div>
            </div>


            <div class="control-group span4">
                <form:label path="recordWeight" cssClass="control-label">备案重量</form:label>
                <div class="controls">
                    <form:input path="recordWeight"/>
                </div>
            </div>


        </div>


        <c:if test="${op eq '新增'}">
            <c:set var="icon" value="icon-file-alt"/>
        </c:if>
        <c:if test="${op eq '修改'}">
            <c:set var="icon" value="icon-edit"/>
        </c:if>
        <c:if test="${op eq '删除'}">
            <c:set var="icon" value="icon-trash"/>
        </c:if>

        <div class="control-group left-group">
            <div>
                <button type="submit" id="sub" class="btn btn-primary">
                    <i class="${icon}"></i>
                        ${op}
                </button>
                <a href="javascript:self.location=document.referrer;" class="btn">
                    <i class="icon-reply"></i>
                    返回
                </a>
            </div>
        </div>
    </form:form>
</div>
<es:contentFooter/>


<script type="text/javascript">


    $(function () {
        $("#editForm").validate({
            rules: {
                customsHandBookCode: {
                    required: true
                }
            },
            messages: {
                customsHandBookCode: {
                    required: "请输入手册号"
                }
            }
        });
    });
    $(function () {
        $("#editForm").submit(function () {
            var flag = $("#editForm").valid();
            if (!flag) {
                return false;
            }
        });
    });
</script>